package yzserver.sx4a.dao.ibatis;

import com.sitech.ibnms.core.BaseIbnmsDao;
import yzserver.sx4a.dao.IPermissionDao;
import yzserver.sx4a.domain.PermissionDomain;

import java.util.HashMap;
import java.util.List;

public class PermissionDaoImpl extends BaseIbnmsDao implements IPermissionDao {

    @Override
    public PermissionDomain selPermission(String permissionid) {
        HashMap map = new HashMap();
        map.put("permissionid",permissionid);
        return (PermissionDomain)querySingle("shanxi_selPermission",map);
    }

    @Override
    public void addPermission(PermissionDomain permission) throws Exception {
        insert("shanxi_addPermission",permission);
    }

    @Override
    public void updPermission(PermissionDomain permission) throws Exception {
        update("shanxi_updPermission",permission);
    }

    @Override
    public void delPermission(String permissionid) throws Exception {
        HashMap map = new HashMap();
        map.put("permissionid",permissionid);
        delete("shanxi_delPermission",map);
    }

    @Override
    public List<PermissionDomain> selAllPermission(String permissionid){
        HashMap map = new HashMap();
        map.put("permissionid",permissionid);
        return (List<PermissionDomain>)query("shanxi_selAllPermission", map);
    }
}
